package tests.items;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import pages.ComparePage;
import tests.CommonTestSteps;
import utils.Log4Test;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by c242 on 02.07.2014.
 */
public class Compare2Elements extends CommonTestSteps {
    @DataProvider(name = "products")
    public Object[][] createData() {
        return new Object[][] {
                new String[] {"Acer Aspire V3-771G-33118G1TMaii (NX.MECEU.010)", "Acer Aspire E1-570G-53336G1TMnkk (NX.MESEU.015) Black"}
        };
    }

    @Test(dataProvider="products")
    public void compare2Elements(String prod1, String prod2) {
        login();
        findItem(prod1);
        if (!isComparePageAvailable()) {
            addToCompare(prod1);
            findItem(prod2);
            addToCompare(prod2);
        }
        comparisonWorks(prod1,prod2);
        compare();
    }
}
